package org.xnsg.app.model;

import com.eova.common.base.BaseModel;

public class aj_dw_files extends BaseModel<aj_dw_files>
{
  private static final long serialVersionUID = 1064291771401662738L;
  public static final aj_dw_files dao = new aj_dw_files();



	public String className = "com.oss.model.aj_dw_files";


	public String findUrlByfid(String fid){
		String method = "findUrlByfid";
		String prompt = className + "." + method + ">";
		System.out.println(prompt + "start ...");
		String sql = "select url from aj_dw_files where fid = ?";
		System.out.println(prompt + "fid=[" + fid + "]");
		String url = "";
		aj_dw_files result;
		try {
			result = this.findFirst(sql, fid);
			// url = result.getStr("URL");
			url = result.getStr(url);


		} catch ( Exception e) {
		  System.out.println(prompt + e);
	    }
		System.out.println(prompt + "url=[" + url + "]");
		System.out.println(prompt + "end.");
		return url;
	}


	public String findFFNByfid(String fid){
		String method = "findFFNByfid";
		String prompt = className + "." + method + ">";
		System.out.println(prompt + "start ...");
		String sql = "select fname from aj_dw_files where fid = ?";
		System.out.println(prompt + "fid=[" + fid + "]");
		String fname = "";
		aj_dw_files result = null;
		try {
			result = this.findFirst(sql, fid);;
			fname = result.getStr("FNAME");

		} catch ( Exception e) {
		  System.out.println(prompt + e);
	    }
		System.out.println(prompt + "fname=[" + fname + "]");
		System.out.println(prompt + "end.");
		return fname;
	}

	public String findURLByfid2(String fid){
		String method = "findURLByfid2";
		String prompt = className + "." + method + ">";
		System.out.println(prompt + "start ...");
		String result = "NULL";
		String sql = "select url from aj_dw_files t1 where t1.fid = '" + fid + "'";
		System.out.println(prompt + "fid=[" + fid + "]");
		try {
			result = this.findFirst(sql).toString();
		} catch ( Exception e) {
		  System.out.println(prompt + e);
	    }
		System.out.println(prompt + "end.");

		return result;
	}

}